home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1996 September / JCSM Shareware Collection (JCS Distribution) (September 1996).ISO / prgtools / euphor13.zip / MOUSE.E < prev    next >
Text File  |  1995-05-14  |  1KB  |  38 lines

  1.         --------------------
  2.         -- Mouse Routines --
  3.         --------------------
  4. -- You need DOS mouse support for these routines.
  5. -- Using a mouse in SVGA graphics modes is not supported by DOS.
  6.  
  7. -- Mouse Event Numbers:
  8. global constant MOVE = 1,       -- track every movement of the mouse
  9.         LEFT_DOWN = 2,  -- the rest are button pressing/releasing
  10.         LEFT_UP = 4,
  11.         RIGHT_DOWN = 8,
  12.         RIGHT_UP = 16,
  13.         MIDDLE_DOWN = 32,
  14.         MIDDLE_UP = 64
  15.  
  16. constant M_GET_MOUSE = 14,
  17.      M_MOUSE_EVENTS = 15,
  18.      M_MOUSE_POINTER = 24
  19.  
  20. global function get_mouse()
  21. -- report mouse events,
  22. -- returns -1 if no mouse event,
  23. -- otherwise returns {event#, x-coord, y-coord}
  24.     return machine_func(M_GET_MOUSE, 0)
  25. end function
  26.  
  27. global procedure mouse_events(integer events)
  28. -- select the mouse events to be reported by get_mouse()
  29. -- e.g. mouse_events(LEFT_UP + LEFT_DOWN + RIGHT_DOWN)
  30.     machine_proc(M_MOUSE_EVENTS, events)
  31. end procedure
  32.  
  33. global procedure mouse_pointer(integer show_it)
  34. -- show (1) or hide (0) the mouse pointer
  35.     machine_proc(M_MOUSE_POINTER, show_it)
  36. end procedure
  37.  
  38.